﻿<!--
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.
-->

<ResourceDictionary
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:controls="using:System.Windows.Controls"
  xmlns:controlsPrimitives="using:System.Windows.Controls.Primitives">

    <Style TargetType="controlsPrimitives:CalendarDayButton">
        <Setter Property="Background" Value="#FFBADDE9" />
        <Setter Property="FontSize" Value="10" />
        <Setter Property="HorizontalContentAlignment" Value="Center" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="MinWidth" Value="5" />
        <Setter Property="MinHeight" Value="5" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="controlsPrimitives:CalendarDayButton">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0:0:0.1" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation
                                          Storyboard.TargetName="Background"
                                          Storyboard.TargetProperty="Opacity"
                                          To=".5"
                                          Duration="0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimation
                                          Storyboard.TargetName="Background"
                                          Storyboard.TargetProperty="Opacity"
                                          To=".5"
                                          Duration="0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation
                                          Storyboard.TargetName="Background"
                                          Storyboard.TargetProperty="Opacity"
                                          To="0"
                                          Duration="0" />
                                        <DoubleAnimation
                                          Storyboard.TargetName="Content"
                                          Storyboard.TargetProperty="Opacity"
                                          To=".35"
                                          Duration="0" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Unselected" />
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <DoubleAnimation
                                          Storyboard.TargetName="SelectedBackground"
                                          Storyboard.TargetProperty="Opacity"
                                          To=".75"
                                          Duration="0" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CalendarButtonFocusStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="CalendarButtonFocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames
                                          Storyboard.TargetName="FocusVisual"
                                          Storyboard.TargetProperty="Visibility"
                                          Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="CalendarButtonUnfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames
                                          Storyboard.TargetName="FocusVisual"
                                          Storyboard.TargetProperty="Visibility"
                                          Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ActiveStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Active" />
                                <VisualState x:Name="Inactive">
                                    <Storyboard>
                                        <ColorAnimation
                                          Storyboard.TargetName="Content"
                                          Storyboard.TargetProperty="(ContentControl.Foreground).(GradientBrush.GradientStops)[2].(GradientStop.Color)"
                                          To="#FF777777"
                                          Duration="0" />
                                        <ColorAnimation
                                          Storyboard.TargetName="Content"
                                          Storyboard.TargetProperty="(ContentControl.Foreground).(GradientBrush.GradientStops)[3].(GradientStop.Color)"
                                          To="#FF777777"
                                          Duration="0" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="DayStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="RegularDay" />
                                <VisualState x:Name="Today">
                                    <Storyboard>
                                        <DoubleAnimation
                                          Storyboard.TargetName="TodayBackground"
                                          Storyboard.TargetProperty="Opacity"
                                          To="1"
                                          Duration="0" />
                                        <DoubleAnimation
                                          Storyboard.TargetName="Content"
                                          Storyboard.TargetProperty="(ContentControl.Foreground).(GradientBrush.GradientStops)[1].(GradientStop.Offset)"
                                          To="1"
                                          Duration="0" />
                                        <DoubleAnimation
                                          Storyboard.TargetName="Content"
                                          Storyboard.TargetProperty="(ContentControl.Foreground).(GradientBrush.GradientStops)[2].(GradientStop.Offset)"
                                          To="1"
                                          Duration="0" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="BlackoutDayStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="NormalDay" />
                                <VisualState x:Name="BlackoutDay">
                                    <Storyboard>
                                        <DoubleAnimation
                                          Storyboard.TargetName="BlackoutVisual"
                                          Storyboard.TargetProperty="Opacity"
                                          To=".2"
                                          Duration="0" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        
                        <Rectangle
                          x:Name="TodayBackground"
                          RadiusX="1"
                          RadiusY="1"
                          Opacity="0"
                          Fill="#FFAAAAAA" />
                        <Rectangle
                          x:Name="SelectedBackground"
                          RadiusX="1"
                          RadiusY="1"
                          Opacity="0"
                          Fill="{TemplateBinding Background}" />
                        <Rectangle
                          x:Name="Background"
                          RadiusX="1"
                          RadiusY="1"
                          Opacity="0"
                          Fill="{TemplateBinding Background}" />
                        
                        <ContentControl
                          x:Name="Content"
                          IsTabStop="False"
                          Content="{TemplateBinding Content}"
                          ContentTemplate="{TemplateBinding ContentTemplate}"
                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                          FontSize="{TemplateBinding FontSize}"
                          Margin="5,1,5,1">
                            <ContentControl.Foreground>
                                <LinearGradientBrush>
                                    <GradientStop Offset="0" Color="#FFFFFFFF" />
                                    <GradientStop Offset="0" Color="#FFFFFFFF" />
                                    <GradientStop Offset="0" Color="#FF333333" />
                                    <GradientStop Offset="1" Color="#FF333333" />
                                </LinearGradientBrush>
                            </ContentControl.Foreground>
                        </ContentControl>
                        
                        <Path
                          x:Name="BlackoutVisual"
                          Opacity="0"
                          Margin="3"
                          HorizontalAlignment="Stretch"
                          VerticalAlignment="Stretch"
                          RenderTransformOrigin="0.5,0.5"
                          Fill="#FF000000"
                          Stretch="Fill"
                          Data="M8.1772461,11.029181 L10.433105,11.029181 L11.700684,12.801641 L12.973633,11.029181 L15.191895,11.029181 L12.844727,13.999395 L15.21875,17.060919 L12.962891,17.060919 L11.673828,15.256231 L10.352539,17.060919 L8.1396484,17.060919 L10.519043,14.042364 z" />
                        <Rectangle
                          x:Name="FocusVisual"
                          Visibility="Collapsed"
                          IsHitTestVisible="false"
                          RadiusX="1"
                          RadiusY="1"
                          Stroke="#FF6DBDD1" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>
